package scale.GUI;

import java.awt.Color;
import java.awt.ComponentOrientation;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;
import javax.swing.JTextField;

public class ArrowText extends JPanel {
	
	JTextField t1 = new JTextField();
	JTextField t2 = new JTextField();
	JTextField t3 = new JTextField();
	JTextField t4 = new JTextField();
	JTextField t5 = new JTextField();
	JTextField [] knap = {t1,t2,t3,t4,t5};


	public ArrowText(){

		this.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
		this.setLayout(new GridBagLayout());
		GridBagConstraints c = new GridBagConstraints();

		t1.setBackground(Color.black);
		t1.setForeground(Color.green);
		t1.setHorizontalAlignment(JTextField.CENTER);
		t1.setEditable(false);
		c.fill = GridBagConstraints.HORIZONTAL;
		c.ipady = 0;
		c.ipadx = 50;
		c.gridx = 0;
		c.insets = new Insets(0,0,0,0);
		c.gridy = 0;
		c.anchor = GridBagConstraints.FIRST_LINE_END;

		t1.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {


			}
		});

		this.add(t1,c);

		t2.setBackground(Color.black);
		t2.setForeground(Color.green);
		t2.setHorizontalAlignment(JTextField.CENTER);
		t2.setEditable(false);
		c.gridx = 1;

		t2.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {


			}
		});

		this.add(t2,c);

		t3.setBackground(Color.black);
		t3.setForeground(Color.green);
		t3.setHorizontalAlignment(JTextField.CENTER);
		t3.setEditable(false);
		c.gridx = 2;

		t3.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {


			}
		});

		this.add(t3,c);

		t4.setBackground(Color.black);
		t4.setForeground(Color.green);
		t4.setHorizontalAlignment(JTextField.CENTER);
		t4.setEditable(false);
		c.gridx = 3;

		t4.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {


			}
		});

		this.add(t4,c);

		t5.setBackground(Color.black);
		t5.setForeground(Color.green);
		t5.setHorizontalAlignment(JTextField.CENTER);
		t5.setEditable(false);
		c.gridx = 4;

		t5.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {


			}
		});

		this.add(t5,c);
		
	}
	
	
	public void updateText(int i, String s){
		knap[i].setText(s);
	}

}
